﻿using System;

namespace StockAnalyst2.StockGrid
{
	internal class AllColumnsOptions : ICloneable, IEquatable<AllColumnsOptions>
	{
		#region Properties

		public ColumnOptions Symbol { get; set; }
		public ColumnOptions Value { get; set; }
		public ColumnOptions OpenDiffPercentage { get; set; }
		public ColumnOptions PreviousDiffPercentage { get; set; }
		public ColumnOptions BidVolume { get; set; }
		public ColumnOptions Bid { get; set; }
		public ColumnOptions Ask { get; set; }
		public ColumnOptions AskVolume { get; set; }
		public ColumnOptions GapDiffPercentage { get; set; }
		public ColumnOptions BidAskAverage { get; set; }
		public ColumnOptions Max { get; set; }
		public ColumnOptions Min { get; set; }
		public ColumnOptions LastVolume { get; set; }
		public ColumnOptions TotalVolume { get; set; }
		public ColumnOptions LastOperation { get; set; }
		public ColumnOptions MaxOpenDiffPercentage { get; set; }
		public ColumnOptions MinOpenDiffPercentage { get; set; }
		public ColumnOptions OpenValue { get; set; }
		public ColumnOptions PreviousDayValue { get; set; }
		public ColumnOptions Status { get; set; }
		public ColumnOptions Date { get; set; }


		#endregion

		#region Public Methods

		public void Copy(AllColumnsOptions other)
		{
			this.Symbol.Copy(other.Symbol);
			this.Value.Copy(other.Value);
			this.OpenDiffPercentage.Copy(other.OpenDiffPercentage);
			this.PreviousDiffPercentage.Copy(other.PreviousDiffPercentage);
			this.BidVolume.Copy(other.BidVolume);
			this.Bid.Copy(other.Bid);
			this.Ask.Copy(other.Ask);
			this.AskVolume.Copy(other.AskVolume);
			this.GapDiffPercentage.Copy(other.GapDiffPercentage);
			this.BidAskAverage.Copy(other.BidAskAverage);
			this.Max.Copy(other.Max);
			this.Min.Copy(other.Min);
			this.LastVolume.Copy(other.LastVolume);
			this.TotalVolume.Copy(other.TotalVolume);
			this.LastOperation.Copy(other.LastOperation);
			this.MaxOpenDiffPercentage.Copy(other.MaxOpenDiffPercentage);
			this.MinOpenDiffPercentage.Copy(other.MinOpenDiffPercentage);
			this.OpenValue.Copy(other.OpenValue);
			this.PreviousDayValue.Copy(other.PreviousDayValue);
			this.Status.Copy(other.Status);
			this.Date.Copy(other.Date);
		}

		#endregion

		#region ICloneable

		public object Clone()
		{
			AllColumnsOptions result = new AllColumnsOptions();

			result.Symbol = (ColumnOptions)this.Symbol.Clone();
			result.Value = (ColumnOptions)this.Value.Clone();
			result.OpenDiffPercentage = (ColumnOptions)this.OpenDiffPercentage.Clone();
			result.PreviousDiffPercentage = (ColumnOptions)this.PreviousDiffPercentage.Clone();
			result.BidVolume = (ColumnOptions)this.BidVolume.Clone();
			result.Bid = (ColumnOptions)this.Bid.Clone();
			result.Ask = (ColumnOptions)this.Ask.Clone();
			result.AskVolume = (ColumnOptions)this.AskVolume.Clone();
			result.GapDiffPercentage = (ColumnOptions)this.GapDiffPercentage.Clone();
			result.BidAskAverage = (ColumnOptions)this.BidAskAverage.Clone();
			result.Max = (ColumnOptions)this.Max.Clone();
			result.Min = (ColumnOptions)this.Min.Clone();
			result.LastVolume = (ColumnOptions)this.LastVolume.Clone();
			result.TotalVolume = (ColumnOptions)this.TotalVolume.Clone();
			result.LastOperation = (ColumnOptions)this.LastOperation.Clone();
			result.MaxOpenDiffPercentage = (ColumnOptions)this.MaxOpenDiffPercentage.Clone();
			result.MinOpenDiffPercentage = (ColumnOptions)this.MinOpenDiffPercentage.Clone();
			result.OpenValue = (ColumnOptions)this.OpenValue.Clone();
			result.PreviousDayValue = (ColumnOptions)this.PreviousDayValue.Clone();
			result.Status = (ColumnOptions)this.Status.Clone();
			result.Date = (ColumnOptions)this.Date.Clone();

			return result;
		}

		#endregion

		#region IEquatable<ApplicationOptions>

		public bool Equals(AllColumnsOptions other)
		{
			return other.Symbol == this.Symbol &&
			       other.Value == this.Value &&
			       other.OpenDiffPercentage == this.OpenDiffPercentage &&
			       other.PreviousDiffPercentage == this.PreviousDiffPercentage &&
			       other.BidVolume == this.BidVolume &&
			       other.Bid == this.Bid &&
			       other.Ask == this.Ask &&
			       other.AskVolume == this.AskVolume &&
			       other.GapDiffPercentage == this.GapDiffPercentage &&
			       other.BidAskAverage == this.BidAskAverage &&
			       other.Max == this.Max &&
			       other.Min == this.Min &&
			       other.LastVolume == this.LastVolume &&
			       other.TotalVolume == this.TotalVolume &&
			       other.LastOperation == this.LastOperation &&
			       other.MaxOpenDiffPercentage == this.MaxOpenDiffPercentage &&
			       other.MinOpenDiffPercentage == this.MinOpenDiffPercentage &&
			       other.OpenValue == this.OpenValue &&
			       other.PreviousDayValue == this.PreviousDayValue &&
			       other.Status == this.Status &&
			       other.Date == this.Date;
		}

		#endregion
	}
}
